package edu.neu.chenhan.fragment.cooperation;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.google.android.material.tooltip.TooltipDrawable;

import edu.neu.chenhan.R;
import edu.neu.chenhan.model.ToolDetail;

public class ToolDetailFragment extends Fragment {

    private TextView tvToolName, tvToolReleaseDate, tvToolVersion, tvToolFeatures, tvToolTechnicalFeatures;
    private ToolDetail tool;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.activity_tool_development_detail, container, false);

        tvToolName = view.findViewById(R.id.tool_name);
        tvToolReleaseDate = view.findViewById(R.id.tool_release_date);
        tvToolVersion = view.findViewById(R.id.tool_version);
        tvToolTechnicalFeatures = view.findViewById(R.id.tool_technical_features);

        Bundle args = getArguments();
        if (args != null) {
            tool = (ToolDetail) args.getSerializable("tool");
            if (tool != null) {
                tvToolName.setText(tool.getName());
                tvToolVersion.setText(tool.getVersion());
                tvToolFeatures.setText(tool.getFeatures());
                tvToolTechnicalFeatures.setText(tool.getTechnicalFeatures());
            }
        }

        return view;
    }
}